package bz.yfw.example.s3blazeds.part2.helper
{
	import bz.yfw.example.s3blazeds.part2.model.view.EmpViewModel;
	import bz.yfw.example.s3blazeds.part2.view.EmpEditThirdView;
	
	import org.seasar.akabana.yui.framework.ns.viewpart;
	
	import spark.components.Label;
	import spark.components.RadioButton;
	import spark.components.RadioButtonGroup;
	import spark.components.TextInput;
	import spark.components.supportClasses.ViewReturnObject;
	
	use namespace viewpart;

	/**
	 * 社員編集3戻るHelper
	 * @author tokufxug http://twitter.com/tokufxug
	 */ 
	public class EmpEditThirdBackHelper
	{
		public var view:EmpEditThirdView;
		
		viewpart var txtinptEnterCompanyY:TextInput;
		
		viewpart var txtinptEnterCompanyM:TextInput;
		
		viewpart var txtinptEnterCompanyD:TextInput;
		
		viewpart var rdbgrpPosition:RadioButtonGroup;
		
		public function get empViewModel():EmpViewModel {
			return view.viewModel;
		}
		
		public function moveBack(isSystem:Boolean = false):void {
			var vm:EmpViewModel = empViewModel;
			vm.enterCompanyY = txtinptEnterCompanyY.text;
			vm.enterCompanyM = txtinptEnterCompanyM.text;
			vm.enterCompanyD = txtinptEnterCompanyD.text;
			vm.position = rdbgrpPosition.selectedValue as String;
			
			if (!isSystem) {
				view.navigator.popView();
			}
		}
	}
}